package handlers

import (
	"fmt"
	"request_ratelimit/utils"
)

type serviceStruct struct {
	Name   string
	Values []string
}

func (s *serviceStruct) handleRecordsService() (map[string]interface{}, error) {
	ret := make(map[string]interface{})
	fmt.Println("values:>>>> ", s.Values)
	// 遍历values列表请求数据
	for _, val := range s.Values {
		resp, err := utils.HandleUserInfoRateLimitRequest("http://127.0.0.1:9000/index", val)
		if err != nil {
			return nil, err
		}
		// 检查状态码
		fmt.Println("resp:>>> ", resp)
	}

	return ret, nil

}
